Skip to content

fix(startup): reject daemon sockets closed before hello - #805

Merged
V3RON merged 6 commits into
mainfrom
bug/790
Oct 21, 2026
Merged

V3RON merged 6 commits into
mainfrom
bug/790

Conversation

@V3RON

@V3RON V3RON commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Closes #790

Status

Implement: done (2/2 green) Review: round 1, 0 blocking Hardware: n/a Gate: refused (red CI, only flaky-test #807)
Next: gate again once #807 is fixed; no code change needed

  • A launched daemon closing its socket before hello makes simlock daemon start settle with DAEMON_STARTUP_FAILED, exit 1 — triage regression, delivered by SimlockWire and AutoLaunchAdminConnector.finishConnection.
  • A pre-existing daemon's connection loss retains DAEMON_CONNECTION_LOST — closed-before-hello table and existing #684 control cases.
  • MCP also reports DAEMON_STARTUP_FAILED when a launched daemon closes before hello — table test covers the launch loop, the final attempt after exit, and a pre-existing daemon; delivered by connectStartingDaemon.

Audit: stale sweep clean; 9/9 changed functions covered and probed; usage-projection e2e 4/4. The audit also fixed a timing race in the existing #684 silent-probe test that CI hit on the build head. The one local failure is flaky-test #807.

Assumptions

  • Assumption: the bug has no explicit Done when or Tests sections — use its triage reproduction and MCP risk as the two build cycles; preserve the existing pre-existing-daemon tests as controls.

Review

Spec review: 0 blocking, 0 fixed, 2 notes. Code review: 0 blocking, 0 fixed, 1 note. Claims review: 0 blocking, 0 fixed, 0 notes.
Rounds: 1. Tokens: 1.4M.
Runs: 4. Cost USD: 1.2872. Agent seconds: 909.
Assessment: complete

Rejected:

  • spec: src/cli/index.test.ts:1746 adds a probeSent wait no spec line asks for — [nonblocking] it fixes a CI race this PR must keep green
  • spec: src/mcp/connect.test.ts:287 adds refusal rows no spec line asks for — [nonblocking] they guard the new classifier

Written by an agent.

@V3RON V3RON changed the title fix(cli): settle daemon starts when the socket closes before hello fix(startup): reject daemon sockets closed before hello Oct 21, 2026
@V3RON

V3RON commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

Review ledger

Round 1: 40a3dc2

Runs: 4. Cost USD: 1.2872. Agent seconds: 909.
Tokens input 94, output 31261, cache read 1609809, cache write 163870.
- review 1 reviewer: claude-sonnet-5-5 532 s $0.2607
- review 1 reviewer code: claude-opus-5-5 296 s $0.8077
- review 1 reviewer claims: claude-sonnet-5-5 45 s $0.1103
- review 1 reviewer spec: claude-sonnet-5-5 36 s $0.1085
Finding outcomes: {"nonblocking":2}. Classes: {"testing 7":2}.
{"findings":[
{"id":"R1","role":"spec","class":"testing 7","outcome":"nonblocking","path":"src/cli/index.test.ts","round":"1"},
{"id":"R2","role":"spec","class":"testing 7","outcome":"nonblocking","path":"src/mcp/connect.test.ts","round":"1"}]}

Written by an agent.

@V3RON

V3RON commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

Review notes

Not blocking, not verified. Each is one reviewer's claim.

  • code: src/cli/environment.ts the message for a connection lost at hello still says "before answering the startup status probe" — incomplete, not false.

Written by an agent.

@V3RON
V3RON merged commit 2b0659e into main Oct 21, 2026
25 checks passed
@V3RON
V3RON deleted the bug/790 branch October 21, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flaky: usage-projection 'newer stored projection version' gets exit 13 (unsettled top-level await) from simlock daemon start under load

1 participant